package com.ktmall.controller;

import com.ktmall.pojo.BannerItem;
import com.ktmall.service.BannerService;
import com.ktmall.utils.RespMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "轮播图相关接口")
@RestController
@RequestMapping("/uni/home/banner")
public class BannerController {
    @Autowired
    private BannerService bannerService;

    @RequestMapping("/list")
    @ApiOperation("轮播图数据查询")
    public RespMsg select(Integer type){
        List<BannerItem> list = bannerService.findByType(type);
        return RespMsg.success("轮播图列表加载成功！",list);
    }
}
